fix(client): raise project-open and directory-suggestion timeouts for large repos#1620
Open
jms830 wants to merge 1 commit into
Open
fix(client): raise project-open and directory-suggestion timeouts for large repos#1620jms830 wants to merge 1 commit into
jms830 wants to merge 1 commit into
Conversation
…arge repos openProject 10s->60s and getDirectorySuggestions 10s->30s + debounce the project-picker query 250ms. On large local repos the daemon's path-resolve and home-tree scan take several seconds; firing per-keystroke against a 10s timeout raced the suggestion list to empty (e.g. ~/gi found a hit but ~/gith blanked) and surfaced a spurious 'Timeout waiting for message (10000ms)' on add.
| timeout: 10000, | ||
| // Large local repos (e.g. a big monorepo/brain checkout) need >10s for the | ||
| // daemon to resolve the path, detect git, and materialize the workspace. | ||
| timeout: 60000, |
There was a problem hiding this comment.
PR description has the timeout values swapped
The PR description states "openProject timeout from 10s to 30s" and "getDirectorySuggestions timeout from 10s to 60s", but the implementation does the opposite: openProject is raised to 60 000 ms and getDirectorySuggestions to 30 000 ms. The inline code comments and the logic both support the as-implemented values (opening a project does more work), so the code appears correct, but the PR description is misleading for anyone reviewing the change or reading git history.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Linked issue
Closes #1693
Type of change
What does this PR do
Opening a project or fetching folder-picker suggestions silently times out on large home directories. The client used a 10s request timeout for both
openProjectandgetDirectorySuggestions, but the daemon's directory scan routinely takes longer on a big~, so the client gave up before the daemon responded — the picker looked broken even though the daemon was still working.This raises the client timeouts to match real scan times and debounces the suggestion query so a filesystem scan isn't fired on every keystroke:
daemon-client.ts:openProject10s -> 60s (it does the most filesystem work);getDirectorySuggestions10s -> 30s. Inline comments explain each.project-picker-modal.tsx: 250ms debounce on the directory-suggestions query key.No protocol or schema changes; client-only timeout/UX tuning.
How did you verify it
Reproduced live against a daemon running on a Linux host with a large home directory, client connected over the LAN.
Before: the folder picker returned nothing / "open" hung. Daemon
ws_slow_requestlogs showeddirectory_suggestions_requestcompleting on the daemon side but past the 10s client deadline:After: with the raised timeouts the same scans complete and populate the picker; the 250ms debounce stops a scan firing on every keystroke while typing a path.
Checks:
npm run typecheck(app + client) passes,npm run lint0/0,npm run formatclean.Checklist
npm run typecheckpassesnpm run lintpassesnpm run formatran (Biome)